</head>
<body>
<div class="f-sep10"></div>
<div class="f-sep10"></div>
<div class="m-hd m-tabs">
<h2 class="u-tt">栏目管理</h2>
	<div class="more"><a href="javascript:;" onClick="window.location.reload();"><span class="icon">&#xf021;</span> 刷新</a></div>
    <ul>
        <li><a class="z-crt" href="javascript:;"><span class="icon">&#xf101;</span> 栏目列表</a></li>
		<!--foreach:{$model_list $vo}-->
		<li><a class="opentab" href="javascript:void(0);"  title="添加{$vo.name}栏目" url="<?php echo url($vo['model'].'/admin_category/add') ?>" ><span class="icon">&#xf067;</span> 添加{$vo.name}栏目</a></li>
		<!--{/foreach}-->
    </ul>
</div>
<div class="m-list-table">
<table class="m-table m-table-row tablesorter" id="table">
    <thead>
      <tr>
        <th class="cola">ID</th>
        <th>栏目名称</th>
        <th class="cola">顺序</th>
        <th class="cola">栏目显示</th>
        <th class="cola">栏目属性</th>
        <th class="cola">栏目类型</th>
        <th class="cola">操作</th>
      </tr>
      
    </thead>
    <tbody>
    	<!--foreach:{$list $vo}-->
        <tr>
        <td>{$vo.cid}</td>
        <td >{$vo.cname}
        <!--if:{$vo['image']<>''}-->
        <a href="javascript:;" rel="{$vo.image}" class="class_pic"><img align="AbsMiddle" src="__PUBLIC__/images/ico/pic.png" width="14" height="14" alt="" /></a>
        <!--{/if}-->
        </td>
        <td>
        <span class="input_sequence" id="sequence_{$vo.cid}">{$vo.sequence}</span>
        </td>
        <td>
        <!--if:{$vo['show']==1}-->
        <font color=green><b>√</b></font>
        <!--{else}-->
        <font color=red><b>×</b></font>
        <!--{/if}-->
        </td>
        <td>
        <!--if:{$vo['type']==0}-->
        频道
        <!--{else}-->
        列表
        <!--{/if}-->
        </td>
        <td>{$vo.mname}</td>
        <td>
        <a class="opentab operating" href="javascript:void(0);"  title="编辑{$vo.name}栏目" url="<?php echo url($vo['model'].'/admin_category/edit',array('cid' => $vo['cid'])) ?>" ><span class="icon">&#xf040;</span> 修改</a>
        <a class="operating" href="javascript:void(0);" onClick="del('<?php echo url($vo['model'].'/admin_category/del') ?>','{$vo.cid}',this)"><span class="icon">&#xf014;</span> 删除</a>
        
         </td>
      </tr>
        <!--{/foreach}-->
    </tbody>
</table>
</div>
</body>
<script>
var del= new function(){};
Do.ready('base','edit','tip','dialog', function() {
	//编辑表格
	$(".input_sequence").editInPlace({
		url: '{$url(category/ajax_edit)}',
		text_size:3
	});
	//栏目形象图
	$(".class_pic").powerFloat({
		targetMode: "ajax"
	});
	//栏目删除
	window.del = function del(url,cid,obj) {
		ajaxpost({
			name:'删除此栏目会删除栏目下的内容!',
			url:url,
			data:{cid:cid},
			tip:true,
			success:function(){
				$(obj).parent().parent().remove();
			}
		});
	}
});
</script>